package br.unifor.bd.deadlock;

import br.unifor.bd.protocol.Transacao;

public abstract class PrevencaoDeDeadlock {
	private TimestampTransactionOrder transactionOrder = new TimestampTransactionOrder();

	public abstract boolean detectar(Transacao transacao1, Transacao transacao2);

	public abstract String retrievePreventType();

	public void removeTimestamp(String transactionId) {
		transactionOrder.remove(transactionId);
	}

	public void addTimestamp(String t) {
		transactionOrder.add(t);
	}

}
